import 'package:flutter_ncsjqz_getx/generated/json/base/json_convert_content.dart';
import 'package:flutter_ncsjqz_getx/model/commodity_detail_entity.dart';

CommodityDetailEntity $CommodityDetailEntityFromJson(Map<String, dynamic> json) {
	final CommodityDetailEntity commodityDetailEntity = CommodityDetailEntity();
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		commodityDetailEntity.msg = msg;
	}
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		commodityDetailEntity.code = code;
	}
	final CommodityDetailData? data = jsonConvert.convert<CommodityDetailData>(json['data']);
	if (data != null) {
		commodityDetailEntity.data = data;
	}
	return commodityDetailEntity;
}

Map<String, dynamic> $CommodityDetailEntityToJson(CommodityDetailEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['msg'] = entity.msg;
	data['code'] = entity.code;
	data['data'] = entity.data?.toJson();
	return data;
}

CommodityDetailData $CommodityDetailDataFromJson(Map<String, dynamic> json) {
	final CommodityDetailData commodityDetailData = CommodityDetailData();
	final int? commodityId = jsonConvert.convert<int>(json['commodityId']);
	if (commodityId != null) {
		commodityDetailData.commodityId = commodityId;
	}
	final int? shopId = jsonConvert.convert<int>(json['shopId']);
	if (shopId != null) {
		commodityDetailData.shopId = shopId;
	}
	final String? title = jsonConvert.convert<String>(json['title']);
	if (title != null) {
		commodityDetailData.title = title;
	}
	final String? acreage = jsonConvert.convert<String>(json['acreage']);
	if (acreage != null) {
		commodityDetailData.acreage = acreage;
	}
	final dynamic? shopPic = jsonConvert.convert<dynamic>(json['shopPic']);
	if (shopPic != null) {
		commodityDetailData.shopPic = shopPic;
	}
	final String? commodityName = jsonConvert.convert<String>(json['commodityName']);
	if (commodityName != null) {
		commodityDetailData.commodityName = commodityName;
	}
	final String? masterPic = jsonConvert.convert<String>(json['masterPic']);
	if (masterPic != null) {
		commodityDetailData.masterPic = masterPic;
	}
	final int? price = jsonConvert.convert<int>(json['price']);
	if (price != null) {
		commodityDetailData.price = price;
	}
	final int? originalPrice = jsonConvert.convert<int>(json['originalPrice']);
	if (originalPrice != null) {
		commodityDetailData.originalPrice = originalPrice;
	}
	final dynamic? shopName = jsonConvert.convert<dynamic>(json['shopName']);
	if (shopName != null) {
		commodityDetailData.shopName = shopName;
	}
	final String? brief = jsonConvert.convert<String>(json['brief']);
	if (brief != null) {
		commodityDetailData.brief = brief;
	}
	final int? status = jsonConvert.convert<int>(json['status']);
	if (status != null) {
		commodityDetailData.status = status;
	}
	final int? categoryId = jsonConvert.convert<int>(json['categoryId']);
	if (categoryId != null) {
		commodityDetailData.categoryId = categoryId;
	}
	final int? parentCategoryId = jsonConvert.convert<int>(json['parentCategoryId']);
	if (parentCategoryId != null) {
		commodityDetailData.parentCategoryId = parentCategoryId;
	}
	final int? soldNum = jsonConvert.convert<int>(json['soldNum']);
	if (soldNum != null) {
		commodityDetailData.soldNum = soldNum;
	}
	final int? totalStocks = jsonConvert.convert<int>(json['totalStocks']);
	if (totalStocks != null) {
		commodityDetailData.totalStocks = totalStocks;
	}
	final String? content = jsonConvert.convert<String>(json['content']);
	if (content != null) {
		commodityDetailData.content = content;
	}
	final String? deliveryAddress = jsonConvert.convert<String>(json['deliveryAddress']);
	if (deliveryAddress != null) {
		commodityDetailData.deliveryAddress = deliveryAddress;
	}
	final dynamic? skuList = jsonConvert.convert<dynamic>(json['skuList']);
	if (skuList != null) {
		commodityDetailData.skuList = skuList;
	}
	final dynamic? masterUrls = jsonConvert.convert<dynamic>(json['masterUrls']);
	if (masterUrls != null) {
		commodityDetailData.masterUrls = masterUrls;
	}
	final dynamic? slaveUrls = jsonConvert.convert<dynamic>(json['slaveUrls']);
	if (slaveUrls != null) {
		commodityDetailData.slaveUrls = slaveUrls;
	}
	final dynamic? props = jsonConvert.convert<dynamic>(json['props']);
	if (props != null) {
		commodityDetailData.props = props;
	}
	return commodityDetailData;
}

Map<String, dynamic> $CommodityDetailDataToJson(CommodityDetailData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['commodityId'] = entity.commodityId;
	data['shopId'] = entity.shopId;
	data['title'] = entity.title;
	data['acreage'] = entity.acreage;
	data['shopPic'] = entity.shopPic;
	data['commodityName'] = entity.commodityName;
	data['masterPic'] = entity.masterPic;
	data['price'] = entity.price;
	data['originalPrice'] = entity.originalPrice;
	data['shopName'] = entity.shopName;
	data['brief'] = entity.brief;
	data['status'] = entity.status;
	data['categoryId'] = entity.categoryId;
	data['parentCategoryId'] = entity.parentCategoryId;
	data['soldNum'] = entity.soldNum;
	data['totalStocks'] = entity.totalStocks;
	data['content'] = entity.content;
	data['deliveryAddress'] = entity.deliveryAddress;
	data['skuList'] = entity.skuList;
	data['masterUrls'] = entity.masterUrls;
	data['slaveUrls'] = entity.slaveUrls;
	data['props'] = entity.props;
	return data;
}